<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div>
			<div>
				你最喜欢的电影
			</div>
			<select id="film">
				<option value="a1">西游记</option>
				<option value="a2" selected>三国演义</option>
				<option value="a3">水浒传</option>
				<option value="a4">红楼梦</option>
			</select>
			<button type="button" onclick="fn4()">获取选中的</button>
			<button type="button" onclick="fn44()">设置选中项</button>
		</div>
		<script type="text/javascript">
			//获取下拉列表的值
		   	function fn4(){
			   	var film=document.getElementById("film");
			  	//console.dir(film);
			  	var filmV=film.value;
			  	console.log("你选中的电影 filmV:",filmV);
		  	}
		  	//设置下拉列表选中  默认选中项 用selected实现
		  	function fn44(){
				var film=document.getElementById("film");
			  	film.value="a3";
		   	}
		</script>
	</body>
</html>
